package org.carl.base.feishu.bot.model;


import lombok.AllArgsConstructor;
import lombok.Data;
import org.carl.base.feishu.bot.enums.MsgTypeEnum;

/**
 * 消息卡片 具体参考 @see <a href="https://open.feishu.cn/document/ukTMukTMukTM/uEjNwUjLxYDM14SM2ATN">飞书消息卡片</a>
 *
 * @author Carl
 */
@Data
public class InterActiveMsgModel extends MsgModel {

    /**
     * 文本内容对象
     */
    private Card card;

    private InterActiveMsgModel() {
        msg_type = MsgTypeEnum.interactive;
    }

    /**
     * 创建一个text对象
     *
     * @param cardJson String  消息卡片 具体参考 @see <a href="https://open.feishu.cn/document/ukTMukTMukTM/uEjNwUjLxYDM14SM2ATN">飞书消息卡片</a>
     * @return
     */
    public static InterActiveMsgModel card(Object cardJson) {
        InterActiveMsgModel interActiveMsgModel = new InterActiveMsgModel();
        interActiveMsgModel.card = new Card(cardJson);
        return interActiveMsgModel;
    }


    @Data
    @AllArgsConstructor
    public static class Card {
        private Object card;
    }
}
